<template>
  <div>
    <el-table
      :data="tableData"
      header-cell-class-name="eltablebg"
      style="width: 100%;margin-bottom:30px"
    >
      <el-table-column
        prop="created_at"
        :label="$t('assets.time')"
      ></el-table-column>
      <el-table-column prop="currency_name" :label="$t('exchange.tradingPair')">
        <template #default="r">
          <span>{{ r.row.symbol_name }}</span>
          <!-- <span>
            {{
              r.row.lever_schema == 1
                ? $t("exchange.marketPrice")
                : r.row.lever_schema == 2
                ? $t("exchange.limitPrice")
                : $t("exchange.stopLoss")
            }}
          </span> -->
        </template>
      </el-table-column>
      <el-table-column prop="lever_type" :label="$t('exchange.direction')">
        <template #default="r">
          <span >
            {{
              r.row.type_name
            }}
          </span>
        </template>
      </el-table-column>
      <el-table-column
        prop="lever_open_price"
        :label="$t('exchange.openingPrice')"
      >
        <template #default="r">{{
          $currency(r.row.open_price)
        }}</template>
      </el-table-column>
      <!-- <el-table-column prop="lever_hand" :label="$t('exchange.lot')">
        <template #default="r">{{ $currency(r.row.lever_hand) }}</template>
      </el-table-column>
      <el-table-column
        prop="lever_earnest_money"
        :label="$t('exchange.margin')"
      >
        <template #default="r">{{
          $currency(r.row.lever_earnest_money)
        }}</template>
      </el-table-column> -->
      <el-table-column prop="trade_fee" :label="$t('assets.handlingFee')">
        <template #default="r">{{ r.row.fee }}</template>
      </el-table-column>
      <el-table-column prop="profit" :label="$t('exchange.profitAndLoss')">
        <template #default="r">
          <div :class="r.row.profit > 0 ? 'text-green' : 'text-red'">
            {{
              r.row.profit > 0
                ? "+" + $currency(r.row.profit)
                : r.row.profit === 0
                ? "--"
                : $currency(r.row.profit)
            }}
          </div>
        </template>
      </el-table-column>
      <el-table-column prop="" :label="$t('assets.status')">
        <template #default="r">
          <span>
            {{
              r.row.status_name
            }}
          </span>
        </template>
      </el-table-column>
      <!-- <el-table-column prop="" :label="$t('exchange.stopLoss')">
        <template #default="r">
          <div>
            {{ $t("exchange.takeProfitPrice") }}:{{
              r.row.stop_win_price === 0
                ? "--"
                : $currency(r.row.stop_win_price)
            }}
          </div>
          <span
            >{{ $t("exchange.stopPrice") }}:{{
              r.row.stop_lose_price === 0
                ? "--"
                : $currency(r.row.stop_lose_price)
            }}</span
          >
        </template>
      </el-table-column> -->
      <template #empty>
        <Norecord />
      </template>
    </el-table>
  </div>
</template>

<script>
import Norecord from "@/components/noRecord/NoRecord.vue";

export default {
  name: "Historycommission",
  props: {
    total: Number,
    current: Number,
    size: Number,
    tableData: Array,
    curentPage: Number,
  },
  components: { Norecord },
};
</script>

<style scoped lang="less">
.jump {
  width: 44px;
  height: 20px;
  line-height: 20px;
  margin-inline-start: 10px;
}
.page {
  width: 20px;
  height: 20px;
}
</style>
